------------------------------------------------------------- BSFONDAY.DLL from BitSoft Utility Software ------------------------------------------------------------- Alex Homer 16 Birkinstyle Avenue Stonebroom Derbyshire DE55 6LF UK Tel/Fax: 0177 387 4661 100416,2030 @ compuserve.com ------------------------------------------------------------- All UK dialling codes have already changed to a new format. Until 16th April 1995 the old codes can still be used, but after that you may find yourself wasting a lot of time listening to wrong number messages, especially for those areas where the new code bears little or no relationship to the old one. This small VB program demonstrates use of BSFONDAY. This DLL provides a function which converts existing UK phone number codes to their new form. The function is named PhoneDay and indexed 1 in the DLL. The syntax of the function is as follows: Function PhoneDay (OldNumber, NumFormat: Pointer; BufferSize: Integer; NewNumber: Pointer): Integer Return Value - 0 (false) = cannot convert number Positive = number of chars in new number You must allocate a return buffer NewNumber of size BufferSize before calling the function. It returns the number of chars in the new number, or zero if the conversion fails. The parameter NumFormat controls the format of the returned number. Set it to a string containing numerics and separators as required, the default is '9999-999-9999'. You can include prefixes such as 'Tel: 99999-999999'. The function correctly handles all UK codes and the international dialling prefix. It also preserves any trailing text such as 'Ext.256', and alternative number suffixes such as '0121-123-4567 / 6' or '0152 223 456 and 458'. ------------------------------------------------------------- Example use in Visual Basic. In declarations section - (all on one line) : Declare Function PhoneDay% Lib "bsfonday.dll" (ByVal OldNumber$, ByVal NumFormat$, ByVal BufferSize%, ByVal NewNumber$) To use the function: Dim NewNum$, OldNum$, FmtStr$ Dim RET% OldNum = txtOldNum ' from Old Number text box FmtStr = cboFormat ' from Format String text box NewNum = String(50, " ") RET = PhoneDay(OldNum, FmtStr, 49, NewNum) If RET > 0 Then lblNewNum = Left(NewNum, RET) ' Converted Number Else lblNewNum = "Invalid" End If ------------------------------------------------------------- Distributing BSFONDAY.DLL You may freely use BSFONDAY.DLL in your own programs. If you intend to distribute programs including the DLL, a one-off payment of £250 (GBP) will secure an unlimited distribution licence. -------------------------------------------------------------